import { _decorator } from "cc";
import NSyncDelete from "../../ngame/sync/state/tools/NSyncDelete";
import { JPost } from "../axios";
import { AddUsePlayerGoodsAPI } from "../GameAPI";
import { NPrefabKeys } from "../GameConst";
import NWorld2Component from "../ngame/sync/NWorld2Component";
const { ccclass } = _decorator;

export default class IBaseCollectController extends NWorld2Component{

    goods:NPrefabKeys;

    num:number = 1;

    onLoad(){
        super.onLoad();
        //监听删除
        this.addSync(new NSyncDelete(this));
    }

    //拾取
    onPickup(playerId:string){

        //拾取
        this.delete();
        AddUsePlayerGoodsAPI(playerId,this.goods,this.num);

    }

}